package com.ssm.service.impl;

import com.ssm.dao.LeaderDao;
import com.ssm.entity.Leader;
import com.ssm.service.LeaderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("leaderService")
public class LeaderServiceImpl implements LeaderService {

    @Resource
    private LeaderDao leaderDao;

    @Override
    public void addLeader(Leader leader) {
        leaderDao.insertLeader(leader);
    }

    @Override
    public void updateLeader(Leader leader) {
        leaderDao.updateLeader(leader);
    }

    @Override
    public void removeBatchLeader(Integer[] ids) {
        leaderDao.deleteBatchLeader(ids);
    }

    @Override
    public List<Leader> listLeader(Leader leader) {
        return leaderDao.selectLeader(leader);
    }


    @Override
    public Leader getLeader(Integer id) {
        return leaderDao.selectOneLeader(id);
    }

    @Override
    public int selectLeaderByname(String name) {
        return leaderDao.selectLeaderByname(name);
    }
}
